<?php
/* @var $this SiteController */
	$this->pageTitle=Yii::app()->name;
?>
<div class="navbar navbar-default">
	<div class="container">
		<span class="glyphicon glyphicon-search"></span>
	</div>
	<table>
		<td>
			<p class="navbar-brand">名字</p>
		</td>
		<td>
			<input id="keyword" name="keyword" type="text" class="form-control" class="search-query" placeholder="姓名">
		</td>
		
		<td>
			<button class="btn btn-default" style="margin-left:15px" onclick="search()">搜索</button>
		</td>
	</table>
</div>

<div id="userList" class="navbar navbar-default">
</div>

<script>
	function goPage(id)
	{
		for (i=0;i<(id-1)*10;i++)
			$('#listT'+i+'T').hide();
		for(i=(id-1)*10;i<(id)*10;i++)
			$('#listT'+i+'T').show();
		for (i=(id)*10;i<userCount;i++)
			$('#listT'+i+'T').hide();
	}
	
	function refreshList()
	{
		var status=$('#status').val();
		var keyword=$('#keyword').val();
		$('#userList').load('<?php echo Yii::app()->request->baseUrl;?>/site/getUserList?status='+status+'&keyword='+keyword);
	}
	
	function search()
	{
		var status=$('#status').val();
		var keyword=$('#keyword').val();
		$('#userList').load('<?php echo Yii::app()->request->baseUrl;?>/site/getUserList?status='+status+'&keyword='+keyword);
	}
	
	function getList(s)
	{
		$('#userList').load('<?php echo Yii::app()->request->baseUrl;?>/site/getUserList?status='+s);
	}
	
	function getUserDetail(id)
	{
		$('.modal-content').load('<?php echo Yii::app()->request->baseUrl;?>/site/viewUserDetail?uid='+id);
	}
	
	function getGradeList()
	{
		$('#grade').load('<?php echo Yii::app()->request->baseUrl;?>/notification/getgradelist');
	}
	
	function getMajorList(did)
	{
		$('#major').load('<?php echo Yii::app()->request->baseUrl;?>/notification/getmajorlist?did='+did,getClassList($('#grade').val(),$('#department').val(),$('#major').val()));
	}
	
	function getDepartmentList()
	{
		$('#department').load('<?php echo Yii::app()->request->baseUrl;?>/notification/getdepartmentlist');
	}
	
	function getClassList(gid,did,mid)
	{
		$('#class').load('<?php echo Yii::app()->request->baseUrl;?>/notification/getclasslist?gid='+gid+'&did='+did+'&mid='+mid);
	}
	refreshList();
</script>

<div class="modal fade in" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
	<div class="modal-dialog">
		<div class="modal-content">
		</div>
	</div><!-- /.modal-dialog -->
</div>